package fr.umlv.ig.model;

import java.awt.Point;

public class Train {
	private final int id;
	private final String name;
	private Itinerary itinerary;
	private Station currentStation;
	private Station nextStation;
	private Point coordinate;
	
	public Train(int id, String name, Itinerary itinerary) {
		this.id = id;
		this.name = name;
		this.itinerary = itinerary;
		currentStation = itinerary.getStart();
		nextStation = currentStation.getNextStation(itinerary.getEnd());
		this.coordinate = new Point(currentStation.getX(), currentStation.getY());
	}

	public int getId() {
		return id;
	}
	
	public String getName() {
		return name;
	}

	void Itinerary(Itinerary itinerary) {
		this.itinerary = itinerary;
	}

	public Itinerary getItinerary() {
		return itinerary;
	}

	void setCurrentStation(Station currentStation) {
		this.currentStation = currentStation;
	}

	public Station getCurrentStation() {
		return currentStation;
	}

	public void setNextStation(Station nextStation) {
		this.nextStation = nextStation;
	}
	
	public Station getNextStation() {
		return nextStation;
	}
	
	public void setCoordinate(Point coordinate) {
		this.coordinate = coordinate;
	}

	public Point getCoordinate() {
		return coordinate;
	}
}
